import { serverUrl } from "../const"

// 登录
export function login(phone, password, platform, success, fail, complete) {
	uni.request({
		url:'http://' + serverUrl + '/oa/login',
		method:"POST",
		data: {phone, password, platform},
		success,
		fail,
		complete
	})
}

// 注册
export function register(name, phone, iddNum, email, password, success, fail, complete) {
	uni.request({
		url:'http://' + serverUrl + '/oa/register',
		method:"POST",
		data: {name, phone, iddNum, email, password},
		success,
		fail,
		complete
	})
}

// 发送邮箱验证码
export function sendMailCode(uid, success, fail, complete) {
	uni.request({
		url:'http://' + serverUrl + '/oa/sendmailcode',
		method:"POST",
		data: {uid},
		success,
		fail,
		complete
	})
}

// 发送短信验证码
export function sendSmsCode(uid, success, fail, complete) {
	uni.request({
		url:'http://' + serverUrl + '/oa/sendsmscode',
		method:"POST",
		data: {uid},
		success,
		fail,
		complete
	})
}

// 通过邮箱重置密码
export function resetPwd(uid, code, pwd, success, fail, complete) {
	uni.request({
		url:'http://' + serverUrl + '/oa/resetPwd',
		method:"POST",
		data: {uid, code, pwd},
		success,
		fail,
		complete
	})
}
